package com.specdot.kraster.gui;

import java.awt.Graphics;

import javax.swing.JPanel;

import com.specdot.kraster.core.Rasterizer;

public class RenderFrame extends JPanel {
	private OnFrameRenderHandler onFrameRenderHandler;
	
	public void setOnFrameRenderHandler(OnFrameRenderHandler onFrameRenderHandler) {
		this.onFrameRenderHandler = onFrameRenderHandler;
	}

	@Override
	public void paint(Graphics g) {
		super.paint(g);
		
		if (onFrameRenderHandler != null) {
			onFrameRenderHandler.handle(getWidth(), getHeight(), g);
		}
	}
}
